import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import java.io.FileOutputStream;

public class Main {
    public static void main(String[] args) {
        System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl");
        transform();
    }

    private static void transform() {
        try {
            TransformerFactory tFactory = TransformerFactory.newInstance();
            Transformer transformer = tFactory.newTransformer(new StreamSource("data/1.xslt"));
            transformer.transform(new StreamSource("data/1.html"), new StreamResult(new FileOutputStream("data/out.xml")));
            System.out.println("************* The result is in out.xml *************");
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }
}
